/******************************************
*               By GuiQing, (c)2010
*
*   XMLstream->DOM->vector<User>->SQLite
*
*   Memory & Time consumption  TO BE considered
*
*   maybe , DOM->SQLite ? Or batch write is faster ?
*
*   And possibility of dangling ptr ? auto_ptr ?
*
******************************************/

/*********************************************************
*                           About the Unicode
*
*wxString uses unicode(UTF-16)
*TinyXML uses UTF-8
*
*So , sina API (UTF-8)-->reqResult(Unicode)-->ToUTF8-->TinyXML(UTF-8)
*And TinyXML(UTF-8)-->FromUTF8-->wxString(Unicode)
*
*There has to be a conversion at every TinyXML in/out
*********************************************************/

#ifndef CUSER_H_INCLUDED
#define CUSER_H_INCLUDED

#include "GlobalConfig.h"
#include <vector>
#include <map>
#include <stdexcept>

typedef std::vector< std::map<wxString , wxString> >   tableType;

class TiXmlDocument;
class TiXmlNode;
class TiXmlElement;

class CUser{

    typedef TiXmlDocument DOM;
    typedef TiXmlNode Node;
    typedef TiXmlElement Element;

    #ifdef UNIT_TEST
    friend class UnitTest_XMLValidator;
    #endif

    private:
        tableType user;

    public:

        DOM* xmlDoc;
        long next_cursor;

        bool startParsing(const wxString& xmlRawStr);
        tableType& getUser() throw();

        CUser();
        virtual ~CUser();
};

#endif // CFOLLOWERPARSER_H_INCLUDED
